Public Class Field



    'Public speed As Integer = 0
    'Const wheelCountMax As Integer = 20
    'Const pbHeight As Integer = 200
    'Const pbWidth As Integer = 20
    'Const oneMeter As Integer = pbHeight / wheelCountMax
    'Dim wCount As Integer = 0
    'Const oneWheel As Integer = 120
    'Const spdMax As Integer = oneWheel * wheelCountMax
    'Const spdMin As Integer = 0

    Const fWidth As Integer = 200
    Const fHeight As Integer = 200


    Public Sub Draw(ByVal g As System.Windows.Forms.PaintEventArgs, ByVal dt As Object)

        Select Case dt

            Case Kmr.DrawType.Start
                g.Graphics.FillRectangle(Brushes.DarkGreen, 0, 0, fWidth, fHeight)


                'mpt = {Point(90, 10), Point(20, 180), Point(190, 50), new Point(10, 70), Point(160, 120)};
                'g.FillPolygon(Brushes.Black, points, FillMode.Alternate);



            Case Kmr.DrawType.Mater
                Select Case speed
                    Case Is > spdMax - oneWheel * 3
                        g.Graphics.FillRectangle(Brushes.Red, 0, wCount, pbWidth, pbHeight)
                    Case Is > spdMax - oneWheel * 12
                        g.Graphics.FillRectangle(Brushes.Orange, 0, wCount, pbWidth, pbHeight)
                    Case Else
                        g.Graphics.FillRectangle(Brushes.Gray, 0, wCount, pbWidth, pbHeight)
                End Select

            Case Kmr.DrawType.None
                Return
        End Select

    End Sub


    Public Sub SpeedControl(ByVal ChangeSpd As Integer)

        If speed > spdMin And speed < spdMax Then
            speed += ChangeSpd
            Kmr.Label1.Text = CStr(speed)
            wCount = pbHeight - speed / oneWheel * oneMeter

        ElseIf speed <= spdMin And ChangeSpd > 0 Then
            speed += ChangeSpd
            Kmr.Label1.Text = CStr(speed)
            wCount = pbHeight - speed / oneWheel * oneMeter

        ElseIf speed >= spdMax And ChangeSpd < 0 Then
            speed += ChangeSpd
            Kmr.Label1.Text = CStr(speed)
            wCount = pbHeight - speed / oneWheel * oneMeter
        End If

    End Sub

    Public Sub aaaaa()

    End Sub
End Class
